import { defineStore } from "pinia";
import { ref } from "vue";

const useUserStore = defineStore('user',()=>{
  //用户信息
    const userId = ref("")
    const userName = ref("")

    function toString(){
      console.log(userId.value,userName.value);
    }

    return {userId,userName,toString};
},{
  //开启用户信息持久化
  persist:true
})

export default useUserStore;
